﻿Imports GestionFicheClient.CnxMySql
Imports GestionFicheClient.ModInterTerm
Public Class interTerminee

    Private Sub interTerminee_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.MdiParent = FrmStart
        txtBoxCom.Text = Com
        txtBoxDate.Text = intDate
        txtBoxFact.Text = Adresse
        txtBoxIdent.Text = Identifiant
        txtBoxMdp.Text = Mdp
        txtBoxNomCli.Text = nomClient
        txtBoxNumInt.Text = numInt
        txtBoxRef.Text = refPc
        txtBoxTelCli.Text = telClient
        txtBoxTypeInt.Text = Type
        cmbBoxTech.Text = Tech
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Ni, Da, Te, Ti, Co, Nc, Tc, Eq, Id, Mdp, Ad, Li, Re, Tp, Ct, Tef As String
        Ni = txtBoxNumInt.Text
        Da = txtBoxDate.Text
        Te = cmbBoxTech.Text
        Ti = txtBoxTypeInt.Text
        Co = txtBoxCom.Text
        Nc = txtBoxNomCli.Text
        Tc = txtBoxTelCli.Text
        Eq = txtBoxRef.Text
        Id = txtBoxIdent.Text
        Mdp = txtBoxMdp.Text
        Ad = txtBoxFact.Text
        Li = ComboBox1.Text
        Re = ComboBox2.Text
        Tp = TextBox1.Text
        Ct = TextBox2.Text
        Tef = TextBox3.Text
        Try
            Executer_Requete_Action("INSERT INTO `archives`(`numInt`, `Date`, `Technicien`, `TypeInter`, `Commentaire`, `NomClient`, `TelClient`, `Equipement`, `Id`, `Mdp`, `AdFact`, `LieuInter`,`Travail_effectué`, `Reglement`, `Durée`, `Cout`) VALUES (" & Ni & ",'" & Da & "','" & Te & "','" & Ti & "','" & Co & "','" & Nc & "','" & Tc & "','" & Eq & "','" & Id & "',' " & Mdp & "',' " & Ad & "',' " & Li & "',' " & Tef & "',' " & Re & "',' " & Tp & "',' " & Ct & "')")
            Executer_Requete_Action("DELETE FROM `interventions` WHERE idIntervention = " & Ni)
            gestionFiches.DataGridView1.DataSource = Executer_Requete_Select("Select idIntervention as Numero_Fiche, dateReception as Date_de_Reception,nomTechnicien as Technicien, typeIntervention as Travail_à_effectuer, commentaire, nomClient as Client,telclient as Telephone_Client, refEquipement as Equipement,identifiant, mdp as Mot_de_passe,adresseFacturation From interventions, techniciens, client where (Client.idClient = interventions.numclient) and (techniciens.idTechniciens = interventions.numtechnicien) and archive = 0")

            Me.Close()

        Catch
        End Try
    End Sub
End Class